package com.example.demo.design.demo06_decorator;

/**
 * Created by 蔡超 on 2018/10/1.
 */
public class TestDecorator {

    public static void main(String[] args) {
        Person person = new Person("小明");
        person.show();

        PersonDecoratorA personDecoratorA = new PersonDecoratorA();
        personDecoratorA.setPerson(person);

        PersonDecoratorB personDecoratorB = new PersonDecoratorB();
        personDecoratorB.setPerson(personDecoratorA);

        PersonDecoratorC personDecoratorC = new PersonDecoratorC();
        personDecoratorC.setPerson(personDecoratorB);

        personDecoratorC.show();

    }

}
